package com.zeh.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author zeh
 * @since 2021-05-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)

public class Message implements Serializable {

    private static final long serialVersionUID=1L;


    @TableId(value = "id", type = IdType.AUTO)
    private Long id;


    private String nickname;


    private String email;


    private String content;

    private String avatar;


    @TableField(fill = FieldFill.INSERT)
    private Date createTime;


    private Long parentMessageId;


    private Boolean adminMessage;

//    //回复留言
    @TableField(exist = false)
    private List<Message> replyMessages = new ArrayList<>();
    @TableField(exist = false)
    private  Message parentMessage;
    @TableField(exist = false)
    private String parentNickname;
}
